<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:replace="dashboard/header :: header"></head>

<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="operlog-form">
					<div class="select-list">
						<ul>
							<li>
								<label>系统模块： </label><input type="text" name="title"/>
							</li>
							<li>
								<label>操作人员： </label><input type="text" name="operName"/>
							</li>
							<li class="select-selectpicker">
								<label>操作类型： </label><select id="businessTypes" class="selectpicker" data-none-selected-text="请选择" multiple>
									<option value="1">新增</option>
									<option value="2">修改</option>
									<option value="3">删除</option>
									<option value="4">授权</option>
									<option value="5">导出</option>
									<option value="6">导入</option>
									<option value="7">强退</option>
									<option value="8">生成代码</option>
									<option value="9">清空数据</option>
								</select>
							</li>
							<li>
								<label>操作状态：</label><select name="status">
									<option value="">所有</option>
									<option value="0">成功</option>
									<option value="1">失败</option>
								</select>
							</li>
							<li class="select-time">
								<label>操作时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="searchPre()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
			<div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()">
		            <i class="fa fa-remove"></i> 删除
		        </a>
		        <a class="btn btn-danger" onclick="$.operate.clean()">
	                <i class="fa fa-trash"></i> 清空
	            </a>
	            <a class="btn btn-warning" onclick="$.table.exportExcel()">
		            <i class="fa fa-download"></i> 导出
		        </a>
	        </div>
	        
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
	
	<footer th:replace="dashboard/footer :: footer"></footer>

	<script>
		var detailFlag = "";
		var datas = [{"searchValue":null,"createBy":"admin","createTime":"2018-03-16 03:33:00","updateBy":null,"updateTime":null,"remark":"\u65B0\u589E\u64CD\u4F5C","params":{},"dictCode":16,"dictSort":1,"dictLabel":"\u65B0\u589E","dictValue":"1","dictType":"sys_oper_type","cssClass":"","listClass":"info","isDefault":"N","status":"0"},{"searchValue":null,"createBy":"admin","createTime":"2018-03-16 03:33:00","updateBy":null,"updateTime":null,"remark":"\u4FEE\u6539\u64CD\u4F5C","params":{},"dictCode":17,"dictSort":2,"dictLabel":"\u4FEE\u6539","dictValue":"2","dictType":"sys_oper_type","cssClass":"","listClass":"info","isDefault":"N","status":"0"},{"searchValue":null,"createBy":"admin","createTime":"2018-03-16 03:33:00","updateBy":null,"updateTime":null,"remark":"\u5220\u9664\u64CD\u4F5C","params":{},"dictCode":18,"dictSort":3,"dictLabel":"\u5220\u9664","dictValue":"3","dictType":"sys_oper_type","cssClass":"","listClass":"danger","isDefault":"N","status":"0"},{"searchValue":null,"createBy":"admin","createTime":"2018-03-16 03:33:00","updateBy":null,"updateTime":null,"remark":"\u6388\u6743\u64CD\u4F5C","params":{},"dictCode":19,"dictSort":4,"dictLabel":"\u6388\u6743","dictValue":"4","dictType":"sys_oper_type","cssClass":"","listClass":"primary","isDefault":"N","status":"0"},{"searchValue":null,"createBy":"admin","createTime":"2018-03-16 03:33:00","updateBy":null,"updateTime":null,"remark":"\u5BFC\u51FA\u64CD\u4F5C","params":{},"dictCode":20,"dictSort":5,"dictLabel":"\u5BFC\u51FA","dictValue":"5","dictType":"sys_oper_type","cssClass":"","listClass":"warning","isDefault":"N","status":"0"},{"searchValue":null,"createBy":"admin","createTime":"2018-03-16 03:33:00","updateBy":null,"updateTime":null,"remark":"\u5BFC\u5165\u64CD\u4F5C","params":{},"dictCode":21,"dictSort":6,"dictLabel":"\u5BFC\u5165","dictValue":"6","dictType":"sys_oper_type","cssClass":"","listClass":"warning","isDefault":"N","status":"0"},{"searchValue":null,"createBy":"admin","createTime":"2018-03-16 03:33:00","updateBy":null,"updateTime":null,"remark":"\u5F3A\u9000\u64CD\u4F5C","params":{},"dictCode":22,"dictSort":7,"dictLabel":"\u5F3A\u9000","dictValue":"7","dictType":"sys_oper_type","cssClass":"","listClass":"danger","isDefault":"N","status":"0"},{"searchValue":null,"createBy":"admin","createTime":"2018-03-16 03:33:00","updateBy":null,"updateTime":null,"remark":"\u751F\u6210\u64CD\u4F5C","params":{},"dictCode":23,"dictSort":8,"dictLabel":"\u751F\u6210\u4EE3\u7801","dictValue":"8","dictType":"sys_oper_type","cssClass":"","listClass":"warning","isDefault":"N","status":"0"},{"searchValue":null,"createBy":"admin","createTime":"2018-03-16 03:33:00","updateBy":null,"updateTime":null,"remark":"\u6E05\u7A7A\u64CD\u4F5C","params":{},"dictCode":24,"dictSort":8,"dictLabel":"\u6E05\u7A7A\u6570\u636E","dictValue":"9","dictType":"sys_oper_type","cssClass":"","listClass":"danger","isDefault":"N","status":"0"}];
		var prefix = ctx + "monitor/operlog";

		$(function() {
		    var options = {
		        url: ctx+"boot/platform/member/datatables" ,
		        cleanUrl: prefix + "/clean",
		        detailUrl: ctx+"boot/platform/member/detail?id={id}",
		        removeUrl: ctx+"boot/platform/member/delete" ,
		        exportUrl: prefix + "/export",
		        sortName: "operTime",
		        uniqueId:"id" ,
		        sortOrder: "desc",
		        modalName: "操作日志",
		        escape: true,
		        showPageGo: true,
		        rememberSelected: true,
		        columns: [{field: 'state',checkbox: true },
		        	 
			        {field: 'applicationIdLabel', title: '应用名称'},
			        {field: 'id', title: '头像'},
			        {field: 'userName', title: '用户名称'},
			        {field: 'userAccount', title: '登陆账户'},
			        {field: 'hasStatus', title: '用户状态'},
			        {field: 'addTime', title: '添加时间'}, 
			        
			        {field: 'id' , title: '操作',  align: 'center',  formatter: function(value, row, index) {
			                var actions = [];
			                actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>详细</a>');
			                return actions.join('');
			          }
			     }]
		    };
		    $.table.init(options);
		});
		
		function searchPre() {
		    var data = {};
		    data.businessTypes = $.common.join($('#businessTypes').selectpicker('val'));
		    $.table.search('operlog-form', data);
		}
		
		function resetPre() {
			$.form.reset();
			$("#businessTypes").selectpicker('refresh');
		}
	</script>
</body>
</html>